package groupware;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import org.datanucleus.sco.simple.ArrayList;

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;
import com.google.gwt.dev.util.collect.HashMap;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Hours {
	  @PrimaryKey
	  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	  private Key key;

	  @Persistent
	  private Key task;
	  
	  @Persistent
	  private User owner;

	  @Persistent
	  private Date date;

	  @Persistent
	  private String description;

	  @Persistent
	  private boolean locked = false; //hours locked 
	  
	  @Persistent
	  private double hours;
	  
	  public Hours(
			  Key task,
			  User owner,
			  Date date,
			  String description,
			  Double hours
	  		  ){
		  this.task = task;
		  this.owner = owner;
		  this.date = date;
		  this.description = description;
		  this.hours = hours;
	  }

	  public Key getKey() {
	    return key;
	  }

	  public User getOwner() {
	    return owner;
	  }

	  public Date getDate() {
	    return date;
	  }

	  public String getDescription() {
	    return description;
	  }

	  public double getHours() {
	    return hours;
	  }
	  
	  public boolean isLocked(){
		  return locked;
	  }

	  public String getURLPath() {
	    String key = "2";
	    return "/resource?key=" + key;
	  }

	  public String getDisplayURL() {
	    String key = "2";
	    return "/display?key=" + key;
	  }


	}
